package com.xyxeshang.es.music.backend.mapper;

import com.xyxeshang.es.music.backend.entity.Playlist;
import com.xyxeshang.es.music.backend.entity.PlaylistSong;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @author xyx-Eshang
 */
@Mapper
public interface PlaylistSongMapper {
    /**
     * 01. 查询总数
     *
     * @return
     */
    Integer getCount();

    /**
     * 02. 重置自增主键的序号
     *
     * @param autoIncrement
     */
    void updateAutoIncrement(Integer autoIncrement);

    /**
     * 03. 获取最大的id
     *
     * @return
     */
    Integer getMaxId();

    /**
     * 04. 新增
     *
     * @param playlistSong
     */
    void save(PlaylistSong playlistSong);

    /**
     * 05. 根据id获取
     *
     * @param playlistSongId
     * @return
     */
    PlaylistSong getById(Integer playlistSongId);

    /**
     * 06. 根据歌单id获取
     *
     * @param playlistId
     * @return
     */
    List<PlaylistSong> listByPlaylistId(Integer playlistId);

    /**
     * 07. 根据歌单id和歌曲id删除
     *
     * @param playlistSong
     */
    void deleteByPlaylistIdAndSongId(PlaylistSong playlistSong);

    /**
     * 08. 根据歌单id和歌曲id获取
     *
     * @param playlistSong
     * @return
     */
    PlaylistSong getByPlaylistIdAndSongId(PlaylistSong playlistSong);
}